<template>
  <div class="pro" @click="goDetail(pro.goods_id)">
		<img v-lazy="pro.thumb_url" class="pro_img">
		<div class="pro_text">
			<p>{{ pro.short_name }}</p>
			<p><em>{{ pro.price / 100 | moneyFormat }}</em></p>
		</div>
	</div>
</template>

<script>
  export default {
    props: {
      pro: {
        type: Object,
        required: true
      }
    },
    methods: {
      goDetail(id){
        this.$router.replace('/goods/' + id);
      },
    }
  }
</script>

<style scoped>
.pro{
		float: left;
    	position: relative;
		margin-right: 20px;
		width: 280px;
		height: 250px;
		background: white;
		/* display: flex; */
	}
	.pro>.pro_img{
		margin: 10px 90px;
		width: 120px;
		height: 120px;
	}
	.pro>.pro_text{
		/* margin-top: 30px; */
		height: 100px;
		width: 200px;
		margin: 0 auto;
		text-align: center;
		line-height: 25px;
		overflow: hidden;
	}
	.pro_text>p{
		margin-top: 15px;
		margin-bottom: 0;
	}
	.pro_text>p:first-child{
		font-size: 13px;
		height: 30px;
		display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-overflow: ellipsis;
	}
	.pro_text>p:nth-child(2){
		color: red;
		font-weight: 900;
	}
	.pro>.add_btn{
		position: absolute;
		bottom: 15px;
		right: 20px;
	}
	.add_btn>a button{
    padding: 0;
		width: 90px;
		height: 30px;
    outline: none;

    display: flex;
    justify-content: center;
    align-items: center;
	}
</style>
